i = 1
while i <= 9 :
    n = 1
    while n <= 1 and i <= 1:
        # 这里已经规定死了，就是n和i都等于1
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
        # 这里n+1以后已经退出了循环，后面的每个循环以此类推
    i += 1
    print()
    n= 1
    while n <= 2 and i <= 2:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1

    i += 1
    print()
    n = 1
    while n <= 3 and i <= 3:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i+= 1
    print()
    n = 1
    while n <= 4 and i <= 4:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i += 1
    print()
    n = 1
    while n <= 5 and i<= 5:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i+= 1
    print()
    n= 1
    while n <= 6 and i <= 6:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n+= 1
    i += 1
    print()
    n = 1
    while n <= 7 and i <= 7:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i+= 1
    print()
    n = 1
    while n <= 8 and i <= 8:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i += 1
    print()
    n = 1
    while n <= 9 and i <= 9:
        print("{}*{}={:<2}".format(n,i,n*i),end=" ")
        n += 1
    i+= 1
    print()
print('='*60)


i = 9
while i >= 1:
    n = 1
    while n <= i:
        print('{}*{}={}'.format(n,i,i*n),end=' ')
        n += 1
    print('')
    i -= 1
    #i是从9开始递减

print('='*60)

i = 1
while i <= 9:
    n = 1
    while n <= 9-i:
        print(end="       ")

        n += 1
    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(i,w,i*w),end =" ")
        w -= 1
    i += 1
    print('')
print('='*60)

i = 9
while i <= 9:

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w,i,i*w),end = " ")
        w -= 1
    i += 1
    print('')

i = 8
while i <= 8:
    print(end='       ')
    # 这里的每一行空格是我一个一个试出来的，不晓得什么原理

    w = i
    while (w >= 1):

        print("{}*{}={:<2}".format(w,i,i*w),end=' ')
        w -= 1
    i += 1
    print('')

i = 7
while i <= 7:
    print(end='              ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 6
while i <= 6:
    print(end='                     ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 5
while i <= 5:
    print(end='                            ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 4
while i <= 4:
    print(end='                                   ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 3
while i <= 3:
    print(end='                                          ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 2
while i <= 2:
    print(end='                                                 ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')

i = 1
while i <= 1:
    print(end='                                                        ')

    w = i
    while (w >= 1):
        print("{}*{}={:<2}".format(w, i, i * w), end=" ")
        w -= 1
    i += 1
    print('')



